export default function format(curDate:any) {
    let year = curDate.getFullYear();
    let month = curDate.getMonth() + 1;
    if (month < 10) {
        month = "0" + month;
    }
    let date = curDate.getDate();
    if (date < 10) {
        date = "0" + date;
    }
    let hour = curDate.getHours();
    if (hour < 10) {
        hour = "0" + hour;
    }
    let minute = curDate.getMinutes();
    if (minute < 10) {
        minute = "0" + minute;
    }
    let second = curDate.getSeconds();
    if (second < 10) {
        second = "0" + second;
    }
    curDate = year + "-" + month + "-" + date + " "  + hour + ":" + minute + ":" + second;
    return curDate;

}